package functions;
import main.ContingencyTable;

public class CorrelationFunction extends GeneralFunction {

	public CorrelationFunction(String name) {
		super(name);
	}

	@Override
	public double calculate(ContingencyTable t) {
		return (t.N() * t.f11() - t.f1p() * t.fp1())
				/ (Math.sqrt(t.f1p() * t.fp1() * t.f0p() * t.fp0()));
	}

}
